home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / pxbud.zip / PDXTBL.H < prev    next >
C/C++ Source or Header  |  1991-05-17  |  3KB  |  78 lines

  1. /*┌───────────────────────────────────────────────────────────────────────┐
  2.   │                                                                       │
  3.   │   Module:  PDXTBL.H                                                   │
  4.   │   Author:  Rick Kligman                                               │
  5.   │   Purpose: Paradox Table Base Class Header                            │
  6.   │                                                                       │
  7.   │   Last Modified: 05-17-91 00:34am                                     │
  8.   │                                                                       │
  9.   │   Copyright 1991 Rick Kligman                                         │
  10.   │   This code may be freely used and distributed in commercial apps     │
  11.   │   provided some mention of PXBuddy++ is made in the documentation.    │
  12.   │                                                                       │
  13.   │   Version 1.00                                                        │
  14.   └───────────────────────────────────────────────────────────────────────┘ */
  15.  
  16. #ifndef RKPDXTBL_H
  17. #define RKPDXTBL_H
  18.  
  19. #ifndef   __STRING_H
  20.   #include <string.h>
  21. #endif
  22.  
  23. #ifndef   PXENGINE_H
  24.   extern "C" {
  25.        #include <pxengine.h>
  26.   }
  27. #endif
  28.  
  29. #ifndef   RKPDXFLD_H
  30.   #include "pdxfld.h"
  31. #endif
  32.  
  33. //    ╓─────────────────────────────────────────────────────────────────╖
  34. //    ║                     Base class for Tables                       ║
  35. //    ╚═════════════════════════════════════════════════════════════════╝
  36.  
  37. class pxtable
  38. {
  39. protected:
  40.  
  41.   int     first_open;         // table opened flag
  42.   absfld  **fldptr;           // array of pointers to abstract field class
  43.   int     blanks_as_zeros;    // flag for zeros being written or blanks
  44.   int     numflds;            // number of fields in the table
  45.   int     tbl_open;           // tells whether table is open or not
  46.  
  47.   virtual int init_flds()   { return PXSUCCESS; }
  48.  
  49. public:
  50.  
  51.   TABLEHANDLE   th;
  52.   RECORDHANDLE  rh;
  53.   LOCKHANDLE    lh;
  54.   char          tblname [60];
  55.   int           tblmarker;        // flag for EOT or BOT
  56.   int           keyed;            // is this table keyed?
  57.  
  58.   pxtable();
  59.   ~pxtable();
  60.  
  61.   int   open(char *tablename = "", FIELDHANDLE fh = 0);
  62.   int   read_rec();
  63.   int   read_flds();
  64.   int   put_recappend();
  65.   int   put_recinsert();
  66.   int   put_recupdate();
  67.   int   put_flds();
  68.   int   close();
  69.   int   recget()                  { return( PXRecGet(th, rh) ); }
  70.   int   recupdate()               { return( PXRecUpdate(th, rh) ); }
  71.   int   recinsert()               { return( PXRecInsert(th, rh) ); }
  72.   int   recappend()               { return( PXRecAppend(th, rh) ); }
  73.   int   recnext();
  74.   int   recprev();
  75. };
  76.  
  77. #endif
  78.